import request from '@/utils/request'

// 查询需求发布列表
export function listRelease(query) {
  return request({
    url: '/demand/release/list',
    method: 'get',
    params: query
  })
}

// 查询需求发布列表首页
export function listReleaseIndex(query) {
  return request({
    url: '/demand/release/demandIndex',
    method: 'get',
    params: query
  })
}

export function listExamine(query) {
  return request({
    url: '/demand/release/Audit',
    method: 'get',
    params: query
  })
}

export function receiveList(query) {
  return request({
    url: '/demand/release/receive',
    method: 'get',
    params: query
  })
}

// 查询需求发布详细
export function getRelease(projectId) {
  return request({
    url: '/demand/release/' + projectId,
    method: 'get'
  })
}

// 新增需求发布
export function addRelease(data) {
  return request({
    url: '/demand/release',
    method: 'post',
    data: data
  })
}

// 修改需求发布
export function updateRelease(data) {
  return request({
    url: '/demand/release',
    method: 'put',
    data: data
  })
}

// 删除需求发布
export function delRelease(projectId) {
  return request({
    url: '/demand/release/' + projectId,
    method: 'delete'
  })
}
//关闭需求发布
export function closeRelease(projectId) {
  return request({
    url: '/demand/release/close/' + projectId,
    method: 'get'
  })
}

export function termination(data) {
  return request({
    url: '/demand/release/termination',
    method: 'post',
    data:data
  })
}
//审核通过
export function updateStatus(data) {
  return request({
    url: '/demand/release/examine',
    method: 'post',
    data:data
  })
}
//参与竞标
export function joinBidding(projectId) {
  return request({
    url: '/demand/release/bid/'+projectId,
    method: 'get'
  })
}

//查看所有参与竞标的企业
export function listBidding(query) {
  return request({
    url: '/demand/release/bidder',
    method: 'get',
    params: query
  })
}



